// 结算
<template>
  <div>
    <div class="form">
      <!-- 导航栏 -->
      <van-nav-bar
        title="结算"
        left-arrow
        right-text="设置"
        @click-left="onClickLeft"
        @click-right="onClickRight"
      />
      <van-notice-bar
        wrapable
        :scrollable="false"
        text="
        物流公告：
        因突发疫情影响，部分地区如广州市荔湾区、
        吉林省四平市等受影响区域已暂停发货，
        物流恢复时我们将立即通知并尽快发货，感谢您的谅解~"
      />

      <van-button type="default" url="#">添加地址+</van-button>

      <van-swipe-cell>
        <van-cell :border="false" title="订单" value="仓库" />
      </van-swipe-cell>

      <van-card
        v-for="(item, index) in info.checkItem"
        :key="index"
        :num="item.count"
        :price="item.price.toFixed(2)"
        :desc="item.subtitle"
        :title="item.title"
        :thumb="item.img"
      />
      <van-submit-bar :price="info.totalMoney * 100" button-text="去支付" />
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      chosenAddressId: "1",
      list: [
        {
          id: "1",
          name: "张三",
          tel: "13000000000",
          address: "浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室",
          isDefault: true,
        },
      ],
    };
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
    onClickRight() {
      // console.log(location.hash);
    },
  },
  computed: {
    // cartList() {
    //   //获取状态机购物车信息
    //   return this.$store.state.gcart.cartList;
    // },
    info() {
      //获取所有商品信息
      return this.$store.getters["gcart/info"];
    },
  },
};
</script>

<style lang="less" scoped>
.form .van-address-list {
  padding: 12px 12px;
}
.form .van-button {
  width: 150px;
  display: block;
  margin: 20px auto;
}
</style>